'''
Created on 2015年6月19日

@author: rocknoway
'''
import time
from functools import wraps


def timethis(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        start = time.time()
        result = func(*args, **kwargs)
        end = time.time()
        print(func.__name__, end - start)
        return result
    return wrapper


class A:

    @classmethod
    def method(cls):
        print(cls)


class B:

    def method(cls):
        print(cls)
    method = classmethod(method)

if __name__ == '__main__':
    print("-+" * 30)

    @timethis
    def countdown(n):
        while n > 0:
            n -= 1

    countdown(10000)
